/**
 * [const-animates 动画]
 */
export const POP_ANIMATES = [
  "fade","fade-right","fade-left","fade-up","fade-down",
  "bounce","bounce-right","bounce-left","bounce-up","bounce-down",
  "rotate","rotate-right","rotate-left","rotate-up","rotate-down",
  "slide-right","slide-left","slide-up","slide-down",
  "zoom","zoom-right","zoom-left","zoom-up","zoom-down",
  "flip-y","flip-x","roll","light-speed-right","light-speed-left"
];
// export const PAGE_ANIMATES = [
//   "fadeIn","fadeInRight","fadeInLeft","fadeInUp","fadeInDown",
//   "bounceIn","bounceInRight","bounceInLeft","bounceInUp","bounceInDown",
//   "slideInRight","slideInRight","slideInLeft","slideInUp","slideInDown",
//   "rotateIn","rotateInRight","rotateInLeft","rotateInUp","rotateInDown",
//   "zoomIn","zoomInRight","zoomInLeft","zoomInUp","zoomInDown",
//   "flipInY","flipInX","rollIn","lightSpeedIn"
// ];


export const ANIMATES = {
  /** 进入动画 **/
  ins:[
    {name: "淡入", value: "fadeIn", active: false, triggerType: 'auto'},
    {name: "向左滑入", value: "fadeInRight", active: false, triggerType: 'auto'},
    {name: "外侧向左滑入", value: "fadeInRightBig", active: false, triggerType: 'auto'},
    {name: "向右滑入", value: "fadeInLeft", active: false, triggerType: 'auto'},
    {name: "外侧向右滑入", value: "fadeInLeftBig", active: false, triggerType: 'auto'},
    {name: "向上滑入", value: "fadeInUp", active: false, triggerType: 'auto'},
    {name: "外侧向上滑入", value: "fadeInUpBig", active: false, triggerType: 'auto'},
    {name: "向下滑入", value: "fadeInDown", active: false, triggerType: 'auto'},
    {name: "顶部滑入", value: "fadeInDownBig", active: false, triggerType: 'auto'},
    {name: "左上滑入", value: "fadeInTopLeft", active: false, triggerType: 'auto'},
    {name: "右上滑入", value: "fadeInTopRight", active: false, triggerType: 'auto'},
    {name: "左下滑入", value: "fadeInBottomLeft", active: false, triggerType: 'auto'},
    {name: "右下滑入", value: "fadeInBottomRight", active: false, triggerType: 'auto'},
     
    {name: "向左回弹进入", value: "backInRight", active: false, triggerType: 'auto'},
    {name: "向右回弹进入", value: "backInLeft", active: false, triggerType: 'auto'},
    {name: "向上回弹进入", value: "backInUp", active: false, triggerType: 'auto'},
    {name: "向下回弹进入", value: "backInDown", active: false, triggerType: 'auto'},

    {name: "弹跳进入", value: "bounceIn", active: false, triggerType: 'auto'},
    {name: "向左弹跳进入", value: "bounceInRight", active: false, triggerType: 'auto'},
    {name: "向右弹跳进入", value: "bounceInLeft", active: false, triggerType: 'auto'},
    {name: "向上弹跳进入", value: "bounceInUp", active: false, triggerType: 'auto'},
    {name: "向下弹跳进入", value: "bounceInDown", active: false, triggerType: 'auto'},

    {name: "翻转进入", value: "flip", active: false, triggerType: 'auto'},
    {name: "垂直翻转进入", value: "flipInY", active: false, triggerType: 'auto'},
    {name: "水平翻转进入", value: "flipInX", active: false, triggerType: 'auto'},

    {name: "变形向左飞入", value: "lightSpeedInRight", active: false, triggerType: 'auto'},
    {name: "变形向右飞入", value: "lightSpeedInLeft", active: false, triggerType: 'auto'},

    {name: "顺时旋转进入", value: "rotateIn", active: false, triggerType: 'auto'},
    {name: "从右往下旋入", value: "rotateInDownRight", active: false, triggerType: 'auto'},
    {name: "从左往下旋入", value: "rotateInDownLeft", active: false, triggerType: 'auto'},
    {name: "从右往上旋入", value: "rotateInUpRight", active: false, triggerType: 'auto'},
    {name: "从左往上旋入", value: "rotateInUpLeft", active: false, triggerType: 'auto'},

    {name: "放大渐入", value: "zoomIn", active: false, triggerType: 'auto'},
    {name: "从左向右放大", value: "zoomInRight", active: false, triggerType: 'auto'},
    {name: "从右向左放大", value: "zoomInLeft", active: false, triggerType: 'auto'},
    {name: "从下想上放大", value: "zoomInUp", active: false, triggerType: 'auto'},
    {name: "从上向下放大", value: "zoomInDown", active: false, triggerType: 'auto'},

    {name: "从左向右滑动", value: "slideInRight", active: false, triggerType: 'auto'},
    {name: "从右向左滑动", value: "slideInLeft", active: false, triggerType: 'auto'},
    {name: "从下向上滑动", value: "slideInUp", active: false, triggerType: 'auto'},
    {name: "从上向下滑动", value: "slideInDown", active: false, triggerType: 'auto'},
  ],

  /** 强调动画  hinge jackInTheBox rollIn rollOut**/
  emphasizes:[
    { name: "弹跳", value: "bounce" , active: false, triggerType: 'auto'},
    { name: "闪现", value: "flash" , active: false, triggerType: 'auto'},
    { name: "脉冲", value: "pulse" , active: false, triggerType: 'auto'},
    { name: "橡皮带", value: "rubberBand" , active: false, triggerType: 'auto'},
    { name: "左右晃动", value: "shakeX" , active: false, triggerType: 'auto'},
    { name: "上下晃动", value: "shakeY" , active: false, triggerType: 'auto'},
    { name: "弱晃动", value: "headShake" , active: false, triggerType: 'auto'},
    { name: "悬挂", value: "swing" , active: false, triggerType: 'auto'},
    { name: "中心晃动", value: "tada" , active: false, triggerType: 'auto'},
    { name: "左右强晃动", value: "wobble" , active: false, triggerType: 'auto'},
    { name: "左右拉扯", value: "jello" , active: false, triggerType: 'auto'},
    { name: "心跳", value: "heartBeat" , active: false, triggerType: 'auto'},
    { name: "脱落悬挂", value: "hinge" , active: false, triggerType: 'auto'},
    { name: "放大抖动 ", value: "jackInTheBox" , active: false, triggerType: 'auto'},
    {name: "翻滚进入", value: "rollIn", active: false, triggerType: 'auto'},
    {name: "翻滚飞出", value: "rollOut", active: false, triggerType: 'auto'},
  ],

  /** 退出动画 **/
  outs:[
    {name: "淡出", value: "fadeOut", active: false, triggerType: 'auto'},
    {name: "向左滑出", value: "fadeOutRight", active: false, triggerType: 'auto'},
    {name: "外侧向左滑出", value: "fadeOutRightBig", active: false, triggerType: 'auto'},
    {name: "向右滑出", value: "fadeOutLeft", active: false, triggerType: 'auto'},
    {name: "外侧向右滑出", value: "fadeOutLeftBig", active: false, triggerType: 'auto'},
    {name: "向上滑出", value: "fadeOutUp", active: false, triggerType: 'auto'},
    {name: "外侧向上滑出", value: "fadeOutUpBig", active: false, triggerType: 'auto'},
    {name: "向下滑出", value: "fadeOutDown", active: false, triggerType: 'auto'},
    {name: "顶部滑出", value: "fadeOutDownBig", active: false, triggerType: 'auto'},
    {name: "左上滑出", value: "fadeOutTopLeft", active: false, triggerType: 'auto'},
    {name: "右上滑出", value: "fadeOutTopRight", active: false, triggerType: 'auto'},
    {name: "左下滑出", value: "fadeOutBottomLeft", active: false, triggerType: 'auto'},
    {name: "右下滑出", value: "fadeOutBottomRight", active: false, triggerType: 'auto'},
     
    {name: "向左回弹进出", value: "backOutRight", active: false, triggerType: 'auto'},
    {name: "向右回弹进出", value: "backOutLeft", active: false, triggerType: 'auto'},
    {name: "向上回弹进出", value: "backOutUp", active: false, triggerType: 'auto'},
    {name: "向下回弹进出", value: "backOutDown", active: false, triggerType: 'auto'},

    {name: "弹跳进出", value: "bounceOut", active: false, triggerType: 'auto'},
    {name: "向左弹跳进出", value: "bounceOutRight", active: false, triggerType: 'auto'},
    {name: "向右弹跳进出", value: "bounceOutLeft", active: false, triggerType: 'auto'},
    {name: "向上弹跳进出", value: "bounceOutUp", active: false, triggerType: 'auto'},
    {name: "向下弹跳进出", value: "bounceOutDown", active: false, triggerType: 'auto'},

    {name: "翻转进出", value: "flip", active: false, triggerType: 'auto'},
    {name: "垂直翻转进出", value: "flipOutY", active: false, triggerType: 'auto'},
    {name: "水平翻转进出", value: "flipOutX", active: false, triggerType: 'auto'},

    {name: "变形向左飞出", value: "lightSpeedOutRight", active: false, triggerType: 'auto'},
    {name: "变形向右飞出", value: "lightSpeedOutLeft", active: false, triggerType: 'auto'},

    {name: "顺时旋转进出", value: "rotateOut", active: false, triggerType: 'auto'},
    {name: "从右往下旋出", value: "rotateOutDownRight", active: false, triggerType: 'auto'},
    {name: "从左往下旋出", value: "rotateOutDownLeft", active: false, triggerType: 'auto'},
    {name: "从右往上旋出", value: "rotateOutUpRight", active: false, triggerType: 'auto'},
    {name: "从左往上旋出", value: "rotateOutUpLeft", active: false, triggerType: 'auto'},

    {name: "缩小渐出", value: "zoomOut", active: false, triggerType: 'auto'},
    {name: "从左向右缩小", value: "zoomOutRight", active: false, triggerType: 'auto'},
    {name: "从右向左缩小", value: "zoomOutLeft", active: false, triggerType: 'auto'},
    {name: "从下想上缩小", value: "zoomOutUp", active: false, triggerType: 'auto'},
    {name: "从上向下缩小", value: "zoomOutDown", active: false, triggerType: 'auto'},

    {name: "从左向右滑动", value: "slideOutRight", active: false, triggerType: 'auto'},
    {name: "从右向左滑动", value: "slideOutLeft", active: false, triggerType: 'auto'},
    {name: "从下向上滑动", value: "slideOutUp", active: false, triggerType: 'auto'},
    {name: "从上向下滑动", value: "slideOutDown", active: false, triggerType: 'auto'},
  ],
}

export function getAnimateData(){
  let animates = _.cloneDeep(ANIMATES);
  for(let key in animates){
    let arr = animates[key];
    arr.forEach(animateItem => {
      animateItem.isHover = false;
      animateItem.classStr = animateItem.value + '_ animate-sprite';
      animateItem.classStrHover = animateItem.value + '_hover_ animate-sprite-hover';
    });
  }
  return animates;
}
export const SCROLL_TRIGGER_TYPE = [
  { name:'无', value:0 },
  { name:'组件中心移动', value:1 },
  { name:'图文缓动', value:2 },
  { name:'滚动固定', value:3 },
  { name:'滚动查看商品', value:4 },
  { name:'多层背景', value:5 },
]
export const SCROLL_TRIGGER_TYPE_MAP = {
  none: 0,
  compMoveToCenter: 1,
  imgAndWordEase: 2,
  fixed: 3,
  offsetGood: 4,
  multiBg: 5,
}
export const ANIMATE_TRIGGER_TYPE = [
  { name:'自动', value: 0 },
  { name:'点击', value: 1 },
]
export const ANIMATE_TRIGGER_TYPE_MAP = {
  auto: 0,
  click: 1,
}
export const GSAP_FROM_TYPES = [
  { name:'中心', value: 'center' },
  { name:'尾部', value: 'end' },
  { name:'边沿', value: 'edges' },
  { name:'随机', value: 'random' },
  { name:'无', value: '' },
  // { name:'索引', value: 'index' },
]
export const GSAP_FROM_TYPES_MAP = {
  center: 'center',
  end: 'end',
  edges: 'edges',
  random: 'random',
  index: 'index',
}
export const GSAP_EASE_TYPES_ = [
  { name:'none', value: 'none' },
  { name:'power1', value: 'power1' },
  { name:'power2', value: 'power2' },
  { name:'power3', value: 'power3' },
  { name:'power4', value: 'power4' },
  { name:'back', value: 'back' },
  { name:'elastic', value: 'elastic' },
  { name:'bounce', value: 'bounce' },
  { name:'circ', value: 'circ' },
  { name:'expo', value: 'expo' },
  { name:'sine', value: 'sine' },
]
export const GSAP_EASE_TYPES = [
  { name:'none', value: 'none' },
  { name:'power1', value: 'power1' },
  { name:'power2', value: 'power2' },
  { name:'power3', value: 'power3' },
  { name:'power4', value: 'power4' },
  // { name:'back', value: 'back', values: [1, 1.4, 1.7, 2, 3, 4] },
  // { name:'elastic', value: 'elastic', values: [[1, 1.2, 1.5, 1.75, 2, 2.5], [0.1, 0.2, 0.3, 0.4, 0.5, 0.75, 1]] },
  { name:'bounce', value: 'bounce' },
  // { name:'rough', value: 'rough', values: { template: GSAP_EASE_TYPES_[0].value, strengh: [0.2, 0.5, 1, 1.5, 2], points:[10, 20, 50, 100, 200], taper: ['none', 'in', 'out', 'both'], randomize: [true, false], clamp: [true, false]} },
  // { name:'slow', value: 'slow', values:[[0.1, 0.3, 0.5, 0.7, 0.9], [0.1, 0.4, 0.7, 1, 2], [true, false]] },
  // { name:'steps', value: 'steps', values: [2,6,12,20,40] },
  { name:'circ', value: 'circ' },
  { name:'expo', value: 'expo' },
  { name:'sine', value: 'sine' },
]
export const GSAP_EASE_TYPES_MAP = {
  none: 'none',
  power1: 'power1',
  power2: 'power2',
  power3: 'power3',
  power4: 'power4',
  back: 'back',
  elastic: 'elastic',
  bounce: 'bounce',
  rough: 'rough',
  steps: 'steps',
  circ: 'circ',
  expo: 'expo',
  sine: 'sine',
}


export const GSAP_AXIS_TYPES = [
  { name:'无', value: '' },
  { name:'x', value: 'x' },
  { name:'y', value: 'y' },
]
export const GSAP_AXIS_TYPES_MAP = {
  none: '',
  x: 'x',
  y: 'y',
}

export const GSAP_EASE_INOUT_TYPES = [
  { name:'none', value: 'none' },
  { name:'in', value: 'in' },
  { name:'out', value: 'out' },
  { name:'inOut', value: 'inOut' },
]
export const GSAP_EASE_INOUT_TYPES_MAP = {
  none: 'none',
  in: 'in',
  out: 'out',
  inOut: 'inOut',
}
//锚,两个控制点,锚,两个控制点,锚等尽可能多的迭代
export const ANIMATE_BEZIER_TYPE = [
  { name:'none', value: 'none' },
  { name:'cubic', value: 'cubic' },
]
export const ANIMATE_BEZIER_TYPE_MAP = {
  none: '',
  cubic: 'cubic'
}

